package com.sunchp.nio.sample.thrift;

public class TransportException extends RuntimeException {
    public static final int UNKNOWN = 0;
    public static final int NOT_OPEN = 1;
    public static final int ALREADY_OPEN = 2;
    public static final int TIMED_OUT = 3;
    public static final int END_OF_FILE = 4;
    public static final int CORRUPTED_DATA = 5;
    protected int type = UNKNOWN;

    public TransportException() {
        super();
    }

    public TransportException(int type) {
        super();
        type = type;
    }

    public TransportException(int type, String message) {
        super(message);
        type = type;
    }

    public TransportException(String message) {
        super(message);
    }

    public TransportException(int type, Throwable cause) {
        super(cause);
        type = type;
    }

    public TransportException(Throwable cause) {
        super(cause);
    }

    public TransportException(String message, Throwable cause) {
        super(message, cause);
    }

    public TransportException(int type, String message, Throwable cause) {
        super(message, cause);
        type = type;
    }

    public int getType() {
        return type;
    }
}
